MameCFE version 1.04
A Cabinet Front End for the Windows version of MAME (currently 0.125)

by Andrew Empson
andrewe@tbd.co.nz

Requires: DirectX 9 or later, Windows 2000 or later
Written entirely in Ebasic (Freeware) from www.ionicwind.com


Setup: 

Copy MameCFE.exe and DevIL.dll into a folder
Run MameCFE.exe

I've designed this software to run on a cabinet, so Windows is hidden, and the whole front-end is keyboard driven. On my cabinet, it's in the Windows Startup folder, the Start Menu is on Auto-hide, and the wallpaper is black. Icons are all hidden.

On first run, it will build a list of all games supported by your version of MAME (MameList.txt in the MAME folder). Then it will build a list of all games available on your machine (MameCFE.txt). This may take a minute or two depending on your system, and create an ini file (MameCFE.ini). Subsequent runs start up much quicker. If your version of MAME is in a different folder from the default (C:\MAME\), you will need to edit the ini file to set the proper location.

This version also creates a log file for debugging purposes. The log is in the same folder as MameCFE.exe.
As of version 1.04, skins are supported. See the end of this file for an example.


Keys:

Category selection - left or right arrows
Game selection - up or down arrows. Space jumps to the next letter, Alt jumps back a letter
Run a game - Ctrl, Enter or 1 (player 1 start)
Quit - Escape
Change a game's category - Tab


Configuration:

Editing the ini file:
You can edit the MameCFE.ini file to change fonts, Add/Remove/Change Categories,add a background image (JPG, BMP or PNG format) or change colours.

[Categories] section: you can change category names, or add/remove categories 
	(17 maximum). Be aware, if you remove a category and you had games already 
	sorted, your lists will may screwed up.
[MAME] section: enter the location (folder) where MAME.exe is stored
[Snaps] section: enter the location (folder) where your screen shots are
[Roms] section: enter the location (folder) where your roms are stored
[Colours] section: the colours are organised into R, G, B format.
	Back is the background for the list screen
	Dark is the top and bottom of the list, as well as the far left and right of the categories
	Light is the unselected colour, and also gets blended with Dark
	Selected is the currently selected item
[Font] section: the name of the font used for everything
[Current] section: the currently selected category and Selection. These are automatic.
[Background] section: the name of an image (BMP/JPG format) to appear behind the list on the main screen
[System] section: you can either have
	Exit=ShutDown
	or
	Exit=Quit
	If you leave out the Exit entry, MameCFE will ask what to do when you press escape.

	Also you can use
	Window=Windowed
	or
	Window=FullScreen
[Skin] section: Enter the name of a skin you want to use. [Colours], [Font] and [Background]
	in the ini file will be ignored if you use a skin.
	See details on skin editing after the sample INI file.

-----------------Sample Ini file-----------------

[Categories]
Shooting
Driving
Maze
Platform
Fighting
Puzzle
Misc
Broken
Sports
Mature

[MAME]
C:\MAME\

[Snaps]
C:\MAME\Snap\

[Roms]
C:\MAME\Roms\

[Colours]
Back=32,0,0
Dark=32,0,0
Light=128,0,0
Selected=255,128,0

[Font]
Tahoma

[Current]
Category=0
Selection=1

[Background]
C:\MAME\Red.jpg

[System]
Exit=ShutDown
Window=FullScreen

[Skin]
Red.skn

------------------------------------------------------


Editing Skins:

Skins are simple text files. They are organised in much the same way as the ini file, with the following sections.
[Colours] section: Will override the ini file colours, but works the same way in RGB values.
[Title] section: Here you can set the details for the title and exit screens.
	Image is the background image. This will be positioned at 0,0 so make sure it's big enough.
	X and Y are used to position titles and the exit menu
	Font is used to set the title font and exit menu fonts
[Background] section: This is used to set the bitmap used in the background of the main program.
[List] section: The main game list is controlled here, with the following options:
	Style is used to set the shape and the justification of the list.
	You can use the following settings:
	) makes a right hand curved list (default)
	| makes a straight list
	( makes a left hand curved list
	Use an = sign to denote the list itself, and how it's justified.
	Putting an = sign on the left of the shape will right justify the list  =|
	Putting an = sign on the right of the shape will left justify the list  |=
	Putting an = sign on both sides of the shape will center the list       =|=
	Examples: )= =) =)= =| |= =|= (= =( =(=
	X and Y are used to position the list
	Y is the vertical center of the list
	X will change depending on the style (either left, center or right)
	Width sets the maximum width for the list
	Height sets the maximum number of items shown in the list at once
	Font sets the list font
[Categories] section: This is used to control the category selection
	Style is used to set the shape of the category list
	You can use ) | or ( picture them rotated 90 clockwise
	X and Y set the center of the category list
	Width sets the maximum width
	Height sets the maximum point size
	Font sets the category font
[Snapshot] section: Control where the snapshot appears, and at what size
	X and Y set the center of the snapshot
	Width and Height set the maximum width and height to scale the image
[Info] section: Controls the information displayed on selecting a game
	X and Y set the center of the information
	Font sets the information font
	Text sets what you want it to say. You can use the following:
	Plain text will be duplicated as is.
	Text in uppercase and <POINTED BRACKETS> will be replaced if applicable
	<GAMENUMBER> is replaced with the number of the currently selected game
	<GAMETOTAL> is the amount of games in this category
	<CATEGORY> is the currently selected category
	<AVAILABILITY> will be replaced with available or not available
	<GAMENAME> will be replaced with the current selected game
	<TIME> will be replaced with the current time
[TabMenu] section: Controls the style and position of the tab menu
	Style works the same way as with the List section
	You can use =| =|= |= =) =)= )= =( =(= or (=
	Line sets whether the line which joins the selection to the category shows up
	X and Y set the position of the tab menu.

------------------Sample Skin file----------------

[Colours]
Background=0,0,0
Dark=32,0,0
Light=192,0,0
Selection=255,128,0

[Title]
Image=Redt.png
X=400
Y=520
Font=Arial

[Background]
Image=Red.png

[List]
Style=)=
X=300
Y=305
Width=400
Height=28
Font=Arial

[Categories]
Style=|
X=400
Y=10
Width=780
Height=12
Font=Arial

[Snapshot]
X=136
Y=305
Width=252
Height=240

[Info]
X=400
Y=585
Text=Game <GAMENUMBER> of <GAMETOTAL> in the <CATEGORY> category is <AVAILABILITY>.
Font=Arial

[TabMenu]
Style==|
Line=1
X=250
Y=305

------------------------------------------------------